//
//  Range+LNG.swift
//  HanYuanSchool
//
//  Created by sun on 2021/5/11.
//  Copyright © 2021 hanyuan. All rights reserved.
//

import Foundation

public extension NSRange {
    func toRange(string: String) -> Range<String.Index> {
        let startIndex = string.index(string.startIndex, offsetBy: self.location)
        let endIndex = string.index(startIndex, offsetBy: self.length)
        return startIndex..<endIndex
    }
}
